/* Copyright 2008 Bas van den Berg
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef COMMANDS_H
#define COMMANDS_H

#include "Command.h"

namespace Chronos {

class MudContainer;
class MudPlayer;
class MudItem;
class Room;

// parser commands
COMMAND_NO_ARGS(HelpCommand, "help")

// general commands
COMMAND_NO_ARGS(WhoCommand, "who")

COMMAND_NO_ARGS(QuitCommand, "quit")

COMMAND_NO_ARGS(DateCommand, "date")

COMMAND_ONE_ARG(ChangePasswordCommand, "password [new password]")

COMMAND_ONE_ARG(SayCommand, "say [msg]")

COMMAND_NO_ARGS(StatusCommand, "status")

// object commands
COMMAND_NO_ARGS(LookCommand, "look")
COMMAND_ONE_ARG(LookAtCommand, "look at [object]")

COMMAND_ONE_ARG(OpenCommand, "open [object]")
COMMAND_ONE_ARG(CloseCommand, "close [object]")

COMMAND_TWO_ARGS(LockCommand, "lock [object] with [key]")
COMMAND_TWO_ARGS(UnlockCommand, "unlock [object] with [key]")

COMMAND_ONE_ARG(PushCommand, "push [button]")

// mudmobile commands
COMMAND_ONE_ARG(AttackCommand, "attack [creature]")

// mudplayer
COMMAND_ONE_ARG(GreetCommand, "greet [player]")

COMMAND_TWO_ARGS(TellCommand, "tell [player] [message]")

// movement commands
COMMAND_NO_ARGS(NorthCommand, "north")
COMMAND_NO_ARGS(EastCommand, "east")
COMMAND_NO_ARGS(SouthCommand, "south")
COMMAND_NO_ARGS(WestCommand, "west")
COMMAND_NO_ARGS(UpCommand, "up")
COMMAND_NO_ARGS(DownCommand, "down")

// item commands
COMMAND_NO_ARGS(InventoryCommand, "inv")
COMMAND_ONE_ARG(DisposeCommand, "dispose")
COMMAND_ONE_ARG(PickupCommand, "get [item]")
COMMAND_ONE_ARG(DropCommand, "drop [item]")
COMMAND_TWO_ARGS(PutInCommand, "put [item] in [object]")


class GetFromCommand : public Command {
public:
	GetFromCommand() : Command("get [item] from [object]") {}
    virtual void execute(Session& session, const std::string& arg1, const std::string& arg2);
private:
	void moveItem(MudPlayer& player, MudContainer* container, MudItem* item);
};

// Consumable commands
COMMAND_ONE_ARG(DrinkCommand, "drink [drink]")
COMMAND_ONE_ARG(EatCommand, "eat [food]")

// Equipment commands
COMMAND_ONE_ARG(WearCommand, "wear [item]")
COMMAND_ONE_ARG(UnwearCommand, "remove [item]")
COMMAND_NO_ARGS(UnwearAllCommand, "remove all")
COMMAND_NO_ARGS(ShowEquipCommand, "equip")

// alias commands
COMMAND_TWO_ARGS(AliasCommand, "alias [keyword] [value]")
COMMAND_ONE_ARG(UnAliasCommand, "unalias [key]")
COMMAND_NO_ARGS(AliasListCommand, "aliaslist")

// setting commands
COMMAND_NO_ARGS(SettingsCommand, "settings")
COMMAND_TWO_ARGS(SetCommand, "set [setting] [option]")

// Comm commands
COMMAND_NO_ARGS(CommCommand, "comm [list|join|leave|show|create]")
COMMAND_NO_ARGS(CommListCommand, "comm list")
COMMAND_TWO_ARGS(CommChatCommand, "[ [channel] [message]")
COMMAND_ONE_ARG(CommJoinCommand, "comm join [channel]")
COMMAND_ONE_ARG(CommLeaveCommand, "comm leave [channel]")
COMMAND_ONE_ARG(CommShowCommand, "comm show [channel]")
COMMAND_ONE_ARG(CommCreateCommand, "comm create [channel]")

COMMAND_ONE_ARG(PromptCommand, "prompt [custom prompt]. Options are %h%H%d")

// Activity commands
COMMAND_NO_ARGS(SearchCommand, "search")
COMMAND_NO_ARGS(StopCommand, "stop")

COMMAND_NO_ARGS(PlayedCommand, "played")

// Trade commands
COMMAND_NO_ARGS(TradeHelpCommand, "trade [with|stop|accept|add|credits|show|see]");
COMMAND_ONE_ARG(TradeStartCommand, "trade with [player]");
COMMAND_NO_ARGS(TradeStopCommand, "trade stop");
COMMAND_NO_ARGS(TradeAcceptCommand, "trade accept");
COMMAND_ONE_ARG(TradeItemCommand, "trade add [item]");
COMMAND_ONE_ARG(TradeCreditsCommand, "trade credits [amount]");
COMMAND_NO_ARGS(TradeShowCommand, "trade show");
COMMAND_ONE_ARG(TradeSeeCommand, "trade see [item]");


class MudExit;
class MudPlayer;

class MyDefaultCommand : public DefaultCommand {
public:
    virtual void execute(Session& session, const std::string& arg);
private:
    void handleExitObject(MudPlayer& player, MudExit& exit);
};

}

#endif

